import React, { useState } from "react";
import { StyleSheet, Text, View, TouchableOpacity } from "react-native";
import NavTopTab from "./conponents/NavTopTab";
import { useTheme } from '../../Common/components/Theme';
import { Button } from "@ant-design/react-native";
import { useDispatch } from 'react-redux';
import { setThemeType } from '../../Store';


const HomeScreen = () => {
   const { theme, toggleTheme } = useTheme();
   const dispatch = useDispatch();
    const tabs = ["关注", "发现", "论坛"]
    return (
        <View style={{ flex: 1 }}>
            <NavTopTab tabs={tabs}>
                {[
                    <View key="0" style={{ flex: 1 }}>
                        <Button
                            style={{ margin: 10 }}
                            type="primary"
                            onPress={() => dispatch(setThemeType("yellow"))}
                        >
                            <Text>切换主题</Text>
                        </Button>
                        <Button
                            style={{ margin: 10 }}
                            type="primary"
                            onPress={() => dispatch(setThemeType("#1d1d1dff"))}
                        >
                            <Text>切换主题</Text>
                        </Button>
                    </View>,
                    <View key="1"><Text>发现的内容</Text></View>,
                    <View key="2"><Text>论坛的内容</Text></View>
                ]}
            </NavTopTab>
        </View>
    );
};


export default HomeScreen;